/*
 * Package il.ac.biu.cs.grossmm.api.data
 * File Node.java
 * 
 * This is a part of presence service framework API. 
 * See javadoc for more information.
 *  
 * Copyright (C) 2006 Grossmann Mark
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
 * MA  02110-1301, USA.
 */

package il.ac.biu.cs.grossmm.api.data;

import il.ac.biu.cs.grossmm.api.flow.NodeEventInspector;
import il.ac.biu.cs.grossmm.api.flow.NodeInspector;
import il.ac.biu.cs.grossmm.api.flow.NotificationPoint;
import il.ac.biu.cs.grossmm.api.flow.PublicationPoint;
import il.ac.biu.cs.grossmm.api.flow.SubscriptionPoint;

/**
 * Represents a data node of some type. The interface has only methods to query
 * invariant information about node: get parent node, root node and type
 * information about the node.
 * <p>
 * Instances of this interface are provided by relevant methods of
 * {@link SubscriptionPoint}, {@link NotificationPoint} and
 * {@link PublicationPoint}.
 * <p>
 * Access to the dynamic data and structure are provided {@link NodeInspector},
 * {@link NodeEventInspector} and {@link NodeManipulator} interfaces.
 * <p>
 * 
 * @param <N>
 *            Defines a type of the node. For example if <tt>Pidf</tt> is a
 *            Java class representing node type interface, then nodes of this
 *            type are represented by instances of <tt>Node&lt;Pidf&gt</tt>
 *            Java type. Data nodes of types represented by {@link SetOf} and
 *            {@link NodeOf} are represented by instances of
 *            <tt>Node&lt;SetOf&lt;X&gt;&gt;</tt> and
 *            <tt>Node&lt;ValueOf&lt;Y&gt;&gt;</tt> Java types respectively.
 * 
 * @author Mark Grossmann
 */
public interface Node<N> {
	/**
	 * Gets parent node of this node
	 * 
	 * @param
	 * <P>
	 * Parent node type interface
	 * @return parent node
	 */
	<P> Node<P> getParent();

	/**
	 * Gets root node of the data tree to which this data node belongs
	 * 
	 * @param
	 * <P>
	 * @return root node of the data tree to which this data node belongs
	 */
	<P> Root<P> getRoot();

	/**
	 * Gets the type of this node
	 * 
	 * @return type of this node
	 */
	NodeType<N> getNodeType();
}
